package com.ruitu.health_1.mvp.model;

import com.ruitu.arad.api.RxUtil;
import com.ruitu.arad.base.BaseModel;
import com.ruitu.health_1.dao.bean.Category;
import com.ruitu.health_1.dao.http.APIRetrofit;
import com.ruitu.router_module.bean.BaseResult2;
import com.ruitu.router_module.bean.product.ChildrenCategory;

import java.util.List;

import io.reactivex.Observable;

public class CategoryModel {

    public static class CategoryListM extends BaseModel {
        public Observable<BaseResult2<List<Category>>> getCategory() {
            return APIRetrofit.getDefault().onlyFirst()
                    .compose(RxUtil.<BaseResult2<List<Category>>>subIoObMain());
        }
    }

    public static class Category2ListM extends BaseModel
    {
        public Observable<BaseResult2<List<ChildrenCategory>>> childrenCategory(String id){
            return APIRetrofit.getDefault().childrenCategory(id)
                    .compose(RxUtil.<BaseResult2<List<ChildrenCategory>>>subIoObMain());
        }
    }
}
